package com.tandashi.springbootstudy01.dto;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class RestBaseResponse {

    public static final int ERR_OK = 0;
    public static final int ERR_FAIL = 10001;//失败
    public static final int ERR_INTERNAL = 10002;//内部错误

    public static final RestBaseResponse OK = new RestBaseResponse(ERR_OK, "OK");

    @JsonAlias("code")
    private Integer errCode;
    @JsonAlias("message")
    private String errMsg;

    public RestBaseResponse() {
    }

    public RestBaseResponse(Integer errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }
}
